import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    mode: 'history',
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            component: resolve => require(["../components/home"], resolve),
            children: [
                {
                    path: '/',
                    name: 'index',
                    component: resolve => require(["../components/index"], resolve),
                },
                {
                    path: '/subpage',
                    component: resolve => require(["../components/subpage"], resolve),
                    children: [
                        {
                            path: '/about',
                            component: resolve => require(["../components/about"], resolve)
                        },
                        {
                            path: '/contact',
                            name: 'contact',
                            component: resolve => require(["../components/contact"], resolve)
                        },
                        {
                            path: '/process/:processCategory',
                            name: 'process',
                            component: resolve => require(["../components/process"], resolve)
                        },
                        {
                            path: '/hospitals',
                            name: 'hospitals',
                            component: resolve => require(["../components/hospitals"], resolve)
                        },
                        {
                            path: '/honours',
                            name: 'honours',
                            component: resolve => require(["../components/honours"], resolve)
                        },
                        {
                            path: '/news/:category',
                            name: 'category',
                            component: resolve => require(["../components/news"], resolve)
                        },
                        {
                            path: '/news/:category/:newsid',
                            name: 'news',
                            component: resolve => require(["../components/newsDetail"], resolve)
                        },
                    ]
                }
            ]
        },
    ]
})
